Don't leak the format names. (#307190, Morten Welinder)
authorMatthias Clasen <mclasen@redhat.com>
Sun, 12 Jun 2005 21:01:21 +0000 (21:01 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 12 Jun 2005 21:01:21 +0000 (21:01 +0000)
2005-06-12  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkselection.c (gtk_target_list_add_image_targets):
Don't leak the format names.  (#307190, Morten Welinder)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkselection.c

index 99a97c500942aa8beda0c27e6b99c542608ed4d8..580a541a23d035fb1cd97f9ab4a9969dc4d7947c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkselection.c (gtk_target_list_add_image_targets): 
+       Don't leak the format names.  (#307190, Morten Welinder)
+
 2005-06-12  Kjartan Maraas  <kmaraas@gnome.org>
 
        * gdk/x11/gdkasync.c: (send_event_handler): Plug
index 99a97c500942aa8beda0c27e6b99c542608ed4d8..580a541a23d035fb1cd97f9ab4a9969dc4d7947c 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkselection.c (gtk_target_list_add_image_targets): 
+       Don't leak the format names.  (#307190, Morten Welinder)
+
 2005-06-12  Kjartan Maraas  <kmaraas@gnome.org>
 
        * gdk/x11/gdkasync.c: (send_event_handler): Plug
index 99a97c500942aa8beda0c27e6b99c542608ed4d8..580a541a23d035fb1cd97f9ab4a9969dc4d7947c 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkselection.c (gtk_target_list_add_image_targets): 
+       Don't leak the format names.  (#307190, Morten Welinder)
+
 2005-06-12  Kjartan Maraas  <kmaraas@gnome.org>
 
        * gdk/x11/gdkasync.c: (send_event_handler): Plug
index 241a8ff5ff061f52027c8e6f2339e361f6ba4e78..cb5e872ca289f91c391470254b4458f17c8255d1 100644 (file)
@@ -366,15 +366,20 @@ gtk_target_list_add_image_targets (GtkTargetList *list,
   for (f = formats; f; f = f->next)
     {
       GdkPixbufFormat *fmt = f->data;
-      
-      if (strcmp (gdk_pixbuf_format_get_name (fmt), "png") == 0)
+      gchar *name; 
+      name = gdk_pixbuf_format_get_name (fmt);
+      if (strcmp (name, "png") == 0)
        {
          formats = g_slist_delete_link (formats, f);
          formats = g_slist_prepend (formats, fmt);
 
+         g_free (name);
+
          break;
        }
 
+      g_free (name);
     }  
 
   for (f = formats; f; f = f->next)